import { createApp } from 'vue'
import { createPinia } from 'pinia'
import './style.css'
import App from './App.vue'
import router from './router/index.js'
// 导入日志管理器
import logger from './utils/logger.js'
// 导入 i18n 配置
import i18n from './locales/index.js'
// 导入 ant-design-vue
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/reset.css'

// 在应用创建之前初始化日志管理器
logger.init()

const app = createApp(App)
const pinia = createPinia()

app.use(pinia)
app.use(router)
app.use(i18n)
app.use(Antd)
app.mount('#app')

// 将 logger 挂载到全局，方便在开发时使用
if (typeof window !== 'undefined') {
  window.logger = logger
}
